package javaFeature;

public class Draw {
    private int height;

    public Draw(int height) {
        this.height = height;
    }

    public void drawTriangle() {
        for (int i = 1; i <= height; i++) {
            for (int j = 1; j <= height - i; j++)
                System.out.print(" ");
            for (int k = 1; k <= (2 * i - 1); k++)
                System.out.print("*");
            System.out.println();
        }
    }

    void drawRectangle() {
        for (int i = 1; i <= height; i++) {
            for (int j = 1; j <= 3; j++)
                System.out.print("*");
            System.out.println();
        }
    }

    void drawsquare() {
        for (int i = 1; i <= height; i++) {
            for (int k = 1; k <= height; k++)
                System.out.print("*");
            System.out.println();
        }
    }

    void drawParallelogram() {
        for (int i = 1; i <= height; i++) {
            for (int j = 1; j <= i; j++)
                System.out.print(" ");
            for (int k = 1; k <= height; k++)
                System.out.print("*");
            System.out.println();
        }
    }

    public static void main(String[] args) {
        Draw draw = new Draw(5);
        draw.drawTriangle();
        draw.drawRectangle();
        draw.drawsquare();
        draw.drawParallelogram();
    }
}